import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:untitled/router/routes.dart';

class InputArea extends StatelessWidget {
  TextEditingController _usernameController = TextEditingController();
  TextEditingController _passwordController = TextEditingController();
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: [
          TextField(
            controller: _usernameController,
            decoration: InputDecoration(
                labelText: '手机号/邮箱',
                labelStyle: TextStyle(fontWeight: FontWeight.w200)),
          ),
          const SizedBox(height: 16),
          TextField(
            controller: _passwordController,
            obscureText: true,
            decoration: const InputDecoration(
                labelText: '密码',
                labelStyle: TextStyle(fontWeight: FontWeight.w200)),
          ),
          const SizedBox(height: 200),
          Stack(
            children: [
              Column(
                children: [
                  Container(
                    child: InkWell(
                      onTap: () {
                        Routes.push('/bar');
                      },
                      child: Container(
                          width: 400,
                          padding: const EdgeInsets.all(13.0),
                          decoration: BoxDecoration(
                            borderRadius: BorderRadius.circular(30.0), // 圆角半径
                            color: Colors.blue, // 按钮背景颜色
                          ),
                          child: const Center(
                            child: Text(
                              '立即登录',
                              style: TextStyle(
                                color: Colors.white, // 文字颜色
                                fontSize: 15.0,
                              ),
                            ),
                          )),
                    ),
                  ),
                  const SizedBox(
                    height: 20,
                  ),
                  Container(
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        InkWell(
                          onTap: () {
                            // 处理忘记密码的逻辑
                            print('忘记密码');
                          },
                          child: const Text(
                            '忘记密码',
                            style:
                                TextStyle(color: Color.fromARGB(255, 0, 0, 0)),
                          ),
                        ),
                        InkWell(
                          onTap: () {
                            // 处理注册账号的逻辑
                            Routes.push('/reg');
                          },
                          child: const Text(
                            '注册账号',
                            style:
                                TextStyle(color: Color.fromARGB(255, 0, 0, 0)),
                          ),
                        ),
                      ],
                    ),
                  ),
                  const SizedBox(
                    height: 30,
                  ),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      BrnCheckbox(
                        radioIndex: 5,
                        isSelected: false,
                        childOnRight: true,
                        mainAxisSize: MainAxisSize.max,
                        child: Align(
                          alignment: Alignment.center,
                          child: Container(
                              child: Row(
                                  mainAxisAlignment: MainAxisAlignment.center,
                                  children: [
                                const Text("是否同意"),
                                InkWell(
                                  child: const Text(
                                    "《软件服务协议》",
                                    style: TextStyle(color: Colors.blue),
                                  ),
                                  onTap: () {
                                    BrnToast.show("点击了软件服务协议", context);
                                  },
                                )
                              ])),
                        ),
                        onValueChangedAtIndex: (index, value) {
                          if (value) {
                            BrnToast.show("第$index项被选中", context);
                          } else {
                            BrnToast.show("第$index项取消选中", context);
                          }
                        },
                      ),
                    ],
                  )
                ],
              )
            ],
          )
        ],
      ),
    );
  }
}
